<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.entity.Article,com.dao.UsersDAO,com.entity.Users"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>文章表</title>
		<link rel="styleSheet"
			href="<%=request.getContextPath()%>/background/css/body.css"
			type="text/css" media="all" />
	</head>

	<body>
		<%
			List<Article> article = (List<Article>) request
					.getAttribute("article");
		%>
		<table>
			<caption>
				<font size="5"><strong>用户信息列表</strong> </font>
			</caption>
			<tr>
				<th>
					文章ID
				</th>
				<th>
					用户名
				</th>
				<th>
					文章名
				</th>
				<th width="40%">
					文章内容
				</th>
				<th colspan="2">
					操作
				</th>

			</tr>
			<%UsersDAO usersDAO=new UsersDAO();
				for (Article a : article) {
				int user_id=a.getUser_id();
				Users users=usersDAO.findById(user_id);
				String user_name=users.getUser_name();
				String content = a.getArticle_content();
			%>
			<tr align="center" onmouseover="this.bgColor='#E6EB00'"
				onmouseout="this.bgColor='white'">
				<td><%=a.getArticle_id()%></td>
				<td><%=user_name%></td>
				<td><%=a.getArticle_name()%></td>
				<td><%=content%></td>

			</tr>
			<%
				}
			%>
			<tr>
				<td colspan="6">
					<p align="left">
						<font size="3" face="微软雅黑"><strong><a
								href="/myblog/background/addarticle.jsp">新增</a> </strong> </font>
					</p>
				</td>
			</tr>
		</table>
	</body>
</html>
